/******************************************************************************
	fb_point():	Draw a point on user's display.
			User can set their point's position and color 
			in this function, then it can be displayed on screen.
******************************************************************************/

#include "head.h"

int fb_pixel(short x, short y, u32_t color)
{

	#if 1	
	u8_t *position = (u8_t *)my_fb.fbmem + ((my_fb.w * y + x) * my_fb.bpp) / 8;
	switch(my_fb.bpp)
	{
	case 32:	*(position + 3) = color >> 24;
	case 24:	*(position + 2) = color >> 16;
	case 16: 	*(position + 1) = color >> 8;
	case 8: 	*(position + 0)	= color;
			return 0;
	default:
			return -1;
	}
	return -1;
	#endif
}

